import axios from "axios";
import { BASE_URL } from './ApiCons'

export function getBookClass ():Promise<any> {
    return axios.get(
        BASE_URL + '/bookClass',
    )
}

export async function getAllBooks (start:number,end:number):Promise<any> {
    return await axios.get(
        BASE_URL + `/book?start=${start}&end=${end}`,
    )
}
export const selectById = (id:any):Promise<any> => {
    return axios.get(
        BASE_URL + `/book/selectOne?id=${id}`
    )
}

export const searchMsg = (clssId:any,bookName:string):Promise<any> => {
    return axios.post(
        BASE_URL + `/book/search`,
        { bookClass:clssId,
          bookName:bookName
         }
    )
}
export const findhMsg = (clssId:any,bookName:string):Promise<any> => {
    return axios.post(
        BASE_URL + `/book/find`,
        { bookClass:clssId,
          bookName:bookName
         }
    )
}